# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: inkyu

import logging


class BaseChecker(object):
  PerProductChecker = None

  def __init__(self, *, products, config, timestamp, logger=None):
    self._config = config
    self._initialized_at = timestamp
    self._last_book_at = None

    self._valid = True
    self._ready = False

    self._per_product = {
        product: self.PerProductChecker(product=product,
                                        config=config.per_product[str(product)],
                                        timestamp=timestamp) for product in products
    }

    self._max_count = 0
    self._logger = logger or logging.getLogger(__name__)

  @property
  def valid(self):
    return self._valid

  @property
  def ready(self):
    return self._ready
